package com.example.joda;

import org.joda.time.*;
import org.joda.time.chrono.CopticChronology;
import org.joda.time.chrono.GJChronology;

import static java.util.Locale.FRENCH;

/**
 * Created by nuno-rafael-figueiredo on 18-03-2014.
 */
public class QuickStartGuide {
    static {
        DateTime dateTime = new DateTime();
        int month = dateTime.getMonthOfYear();
    }

    static {
        DateTime dateTime = new DateTime()
                .withYear(2000)
                .plusHours(2);
    }

    static {
        DateTime dateTime = new DateTime();
        DateTime.Property monthOfYear = dateTime.monthOfYear();
        String monthName = monthOfYear.getAsText();
        String frenchShortName = monthOfYear.getAsShortText(FRENCH);

        boolean isLeapYear = dateTime.year().isLeap();
        DateTime rounded = dateTime.dayOfMonth().roundFloorCopy();
    }

    static {
        Chronology coptic = CopticChronology.getInstance();
    }

    static {
        DateTimeZone zone = DateTimeZone.forID("Asia/Tokyo");
        Chronology gregorianJulian = GJChronology.getInstance(zone);
    }

    static {
        DateTime dt = new DateTime(2005, 3, 26, 12, 0, 0, 0);
        DateTime plusPeriod = dt.plus(Period.days(1));
        DateTime plusDuration = dt.plus(new Duration(24L * 60L * 60L * 1000L));
    }
}
